package com.geen.tuoke.ui.dialog

import android.content.Context
import androidx.databinding.DataBindingUtil
import com.geen.tuoke.R
import com.geen.tuoke.databinding.DialogSureBinding
import com.geen.tuoke.utils.ext.dp2px
import com.geen.tuoke.widget.dialog.DialogViewHolder
import com.geen.tuoke.widget.dialog.XXDialog

/**
 * @Author LuoJi
 * @Date 2022/1/18-16:58
 * @Desc
 */
class DialogSure(context: Context,private val tipMsg:String,private val clickSure:()->Unit):XXDialog(context, R.layout.dialog_sure) {

    private var mBinding : DialogSureBinding? = null

    init {
        setWidthAndHeight(dp2px(288f), dp2px(214f))
    }

    override fun convert(holder: DialogViewHolder) {
        mBinding = DataBindingUtil.bind(holder.convertView)
        mBinding?.let {

            it.btnSure.setOnClickListener {
                clickSure
            }

            it.btnCancel.setOnClickListener {
                dismiss()
            }
            it.tvTips.text = tipMsg
        }
    }
}